@import models.users.NasGroup
@(message: String,groups:Seq[NasGroup])(implicit request: RequestHeader,messagesProvider: MessagesProvider,session:Session)
@import views.html.admin._
@import helper._

@main(message,scripts=js) {

<div><h1>NAS用户管理</h1>    @request.flash.get("success").map { key =>  @messagesProvider.messages(key)}</div>

<hr>
<div class="layui-border-box">
    <div class="layui-row layui-col-space2">
        <form class="layui-form" action="">
            <div class="layui-col-md4">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block ">
                    <input type="text" name="name" value='' class="layui-input" >
                </div>
            </div>
            <div class="layui-col-md2">
                <label class="layui-form-label">启用</label>
                <div class="layui-input-block ">
                    <input type="checkbox" name="active" lay-skin="switch" checked>
                </div>
            </div>

            <div class="layui-col-md3">
                <div class="layui-input-block ">
                    <button class="layui-btn" lay-submit lay-filter="formuserfilter">搜索</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <table class="layui-hide" id="userstable" lay-filter="test"></table>
</div>


<script type="text/html" id="userBarDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="onoff">启/禁</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
</script>
<script type="text/html" id="userBarGroupsDemo">
    <div class="layui-row layui-col-space2">
        <form class="layui-form" action="" lay-filter="jsonSetGroup">
            @CSRF.formField
            <div class="layui-col-md4">
                <label class="layui-form-label">NAS组</label>
                <div class="layui-input-block">
                    <select name="gid" lay-verify="required" lay-search>
                        <option value=0>默认组</option>
                        @for(s<-groups){
                        <option value=@s.id>@s.pname</option>
                        }
                    </select>
                </div>
            </div>

        </form>
        <button class="layui-btn" lay-event="changegroup" >设置</button>
    </div>

</script>
}
@js = {
<script src='@routes.Assets.versioned("js/nas_user.js")' type="text/javascript"></script>
}
